package com.jlu.yygh.controller;

import com.jlu.yygh.common.result.Result;
import com.jlu.yygh.service.DepartmentService;
import com.jlu.yygh.vo.hosp.DepartmentVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

//@CrossOrigin
@Api(tags = "科室排班接口")
@RestController
@RequestMapping(value = "/admin/hosp/department")
public class DepartmentController {

  @Autowired
  private DepartmentService departmentService;

  //根据医院编号，查询医院所有科室列表
  @ApiOperation(value = "查询医院所有科室列表")
  @GetMapping("getDeptList/{hoscode}")
  public Result getDeptList(@PathVariable String hoscode) {
    List<DepartmentVo> list = departmentService.findDeptTree(hoscode);
    return Result.ok(list);
  }
}
